import { createApp } from 'vue'
import router from './router'; // 引入路由配置文件
import './style.css'
import App from './App.vue'







// 设置子应用的 baseroute
// router.beforeEach((to, from, next) => {
// 	console.log(to,'------')
// 	if (window.__MICRO_APP_ENVIRONMENT__) {
// 		console.log(2222)
// 		if (!to.path.startsWith(window.__MICRO_APP_BASE_ROUTE__)) {
// 		  next({
// 			path: window.__MICRO_APP_BASE_ROUTE__ + to.path,
// 			replace: true,
// 		  });
// 		} else {
// 		  next();
// 		}
// 	}
// });
if (window.__MICRO_APP_ENVIRONMENT__) {
	const baseRoute = window.__MICRO_APP_BASE_ROUTE__ || '/'
	router.base = baseRoute
}

const app = createApp(App);
app.use(router); // 使用路由实例
app.mount('#first_child_app')
